#ifndef VERSION_H
#define VERSION_H

#include <QObject>
#include <QTimer>
#include "downloadmanager.h"
#include "library.h"

class Version : public QObject
{
    Q_OBJECT
public:
    explicit Version(QObject *parent = nullptr);
    ~Version();
    void monitor();
signals:
    
private:
    QTimer *timer = nullptr;
    Library *library = nullptr;
    
    const QString path_public_dir = "./www";
    const QString path_library = "./library";
private slots:
    //定时获取版本的json
    void getVersion();
    //然后检查是否有新的版本
    void updateVersion(QString versionJson);
    //解析json的下载模块
    void parseJson(QJsonObject obj);
};

#endif // VERSION_H
